﻿Public Module carregando

    Function MostrarMoeda(Optional CorDaMoeda As String = "amarela", Optional Tamanho As Integer = 50) As PictureBox

        Dim Formulario As Form = Form.ActiveForm
        Dim moedinha As New PictureBox
        Select Case CorDaMoeda
            Case "vermelha"
                moedinha.InitialImage = My.Resources.Red_Coin_SM64
                moedinha.Image = My.Resources.Red_Coin_SM64

            Case "azul"
                moedinha.InitialImage = My.Resources.Blue_Coin_SM64
                moedinha.Image = My.Resources.Blue_Coin_SM64
            Case Else
                moedinha.InitialImage = My.Resources.Yellow_Coin_SM64
                moedinha.Image = My.Resources.Yellow_Coin_SM64
        End Select
        moedinha.Size = New Size(Tamanho, Tamanho)
        moedinha.SizeMode = PictureBoxSizeMode.StretchImage
        moedinha.BackColor = Color.Transparent
        Formulario.Controls.Add(moedinha)
        moedinha.Location = New Point((moedinha.Parent.ClientSize.Width / 2) - (moedinha.Width / 2),
                              (moedinha.Parent.ClientSize.Height / 2) - (moedinha.Height / 2))

        moedinha.BringToFront()
        moedinha.BackColor = Color.Transparent
        moedinha.Refresh()
        Return moedinha
    End Function


End Module
